﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Commerce.Data;

namespace Commerce.CSK.Web
{
    public partial class ViewCategory : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int categoryId; 
            if(int.TryParse(Request.QueryString["c"], out categoryId))
            {
                Category selectedCategory = Services.GetCatalogService().GetCategory(categoryId);
                this.categoryView.SelectedCategory = selectedCategory;
                this.categoryView.DataBind();
                Services.CategoryViewed(categoryId); 
            }
        }
    }
}
